package com.xkstream.client.entity.kt

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by xiaoyi on 2017-11-6.
 */
class BlogInfo() : Parcelable {
    var content: String? = ""
    var comment: Int = 0
    var upvote: Int = 0
    var videos: Array<String>? = null
    var images: Array<String>? = null
    var create_date: String? = ""
    var id: String? = null
    var upvote_id: String? = null

    var delete = false

    constructor(parcel: Parcel) : this() {
        content = parcel.readString()
        comment = parcel.readInt()
        upvote = parcel.readInt()
        videos = parcel.createStringArray()
        images = parcel.createStringArray()
        create_date = parcel.readString()
        id = parcel.readString()
        upvote_id = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(content)
        parcel.writeInt(comment)
        parcel.writeInt(upvote)
        parcel.writeStringArray(videos)
        parcel.writeStringArray(images)
        parcel.writeString(create_date)
        parcel.writeString(id)
        parcel.writeString(upvote_id)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<BlogInfo> {
        override fun createFromParcel(parcel: Parcel): BlogInfo {
            return BlogInfo(parcel)
        }

        override fun newArray(size: Int): Array<BlogInfo?> {
            return arrayOfNulls(size)
        }
    }
}